package com.cykj.page04;

/**
 * @BelongsProject: HandTomcat
 * @BelongsPackage: com.cykj.page04
 * @Author: 阿隆
 * @CreateTime: 2025-10-29 18:59
 * @Description: 三种获取类对象
 * @Version: 1.0
 */
public class Lesson01 {
    public static void main(String[] args) {

        try {
            //1.Class.formName("类的路径")
            Class<?> cls = Class.forName("com.cykj.page04.Student");
            Student student = (Student) cls.newInstance();
           // System.out.println(student.name);

        } catch (Exception e) {
            throw new RuntimeException(e);
        }

        //2.类名.class
        Class<Student> studentClass = Student.class;


        //3.对象.getClass
        Student student = new Student();
        Class<? extends Student> aClass = student.getClass();


    }
}